home *** CD-ROM | disk | FTP | other *** search
- #include <string.h>
- #include <dirent.h>
- #include "fstab.h"
-
- /*
- Get the list of files (anything in fact) in a directory
- Return the number of entry placed in lst.
-
- Return -1 if the directory can't be opened.
- */
- int dir_getlist (const char *path, SSTRINGS &lst)
- {
- int ret = -1;
- DIR *fin = opendir(path);
- if (fin != NULL){
- struct dirent *dire = NULL;
- while ((dire = readdir(fin))!=NULL){
- lst.add (new SSTRING(dire->d_name));
- }
- closedir(fin);
- ret = lst.getnb();
- }
- return ret;
- }
-
-